package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func IndexPage(w http.ResponseWriter, r *http.Request) {
	for key, values := range r.Header {
		fmt.Println(fmt.Sprintf("%s is %v", key, values))
	}
	s, _ := ioutil.ReadAll(r.Body)
	fmt.Println()
	fmt.Println("body content is :")
	fmt.Println(fmt.Sprintf("%s", s))

	w.Write([]byte("this is server write info"))
}
func main() {
	http.HandleFunc("/", IndexPage)
	err := http.ListenAndServe(":81", nil)
	if err != nil {
		fmt.Println(err)
	}
}
